﻿<%@ Page Language="C#" %>
<%
    string xstr = Request.Params["x"];
    string ystr = Request.Params["y"];
    string rstr = Request.Params["r"];
    double x = 0;
    double y = 0;
    double r = 0;
    double.TryParse(xstr, out x);
    double.TryParse(ystr, out y);
    double.TryParse(rstr, out r);
    string title = "架空线断面分析";
    System.Data.DataTable dt = null;
    if (x == 0 || y == 0 || r == 0)
    {
        title = "错误的输入坐标！";
    }
    else
    {
        r = r * 100000;
        string sql = "select t.wireid as wireid,t.starttowername as starttowername,t1.linename as overlinename from tab_wire t,tab_overline t1 where t1.overlineid = t.belongline and SDO_WITHIN_DISTANCE(t.shape,SDO_GEOMETRY('POINT(" + x + " " + y + ")',4326),'distance=" + r + "') = 'TRUE'";
        Maticsoft.DBUtility.DbHelper dbhelper = new Maticsoft.DBUtility.DbHelper();
        dt = dbhelper.ExecuteDataTable(dbhelper.GetSqlStringCommond(sql));        
    }
 %>
<chart caption='<%=title %>' bgAlpha='0' canvasBgAlpha='0' xAxisName='横向距离（米）' baseFontSize='12' yAxisName='高度（米）' xAxisMaxValue='<%=dt.Rows.Count%>' xAxisMinValue='-1' numDivLines='4' showAlternateVGridColor='1' AlternateVGridAlpha='30' numberPrefix='米'>
<categories verticalLineColor='666666' verticalLineAlpha='20'>
<%
    if (dt != null)
    {
        %><category label='-1' x='-1'/><%
        int i = 0;
        foreach (System.Data.DataRow dr in dt.Rows)
        {          
     %>
        <category label='<%=i %>' x='<%=i %>' sL='1'/>     
     <%
         i++;
        }
        %>
        <category label='<%=i %>' x='<%=i %>' sL='1'/>
        <%
    } %>
    </categories>
<dataSet color='ff5904' showValues='0'>
    <set x='1' y='10' z='0' name='Mango' toolText='<%="线路架设方式、线缆型号等信息" %>' />  
    <set x='1' y='10' z='0' name='Mango' toolText='<%="线路架设方式、线缆型号等信息" %>' />  
<%

    if (dt != null)
    {
        int i = 0;
        foreach (System.Data.DataRow dr in dt.Rows)
        {
     %><set x='<%=i %>' y='<%=20 %>' z='<%=20 %>' link="javascript:function a(){document.getElementById('ContFrame').src='../Public/CommonPage.aspx?table=TAB_WIRE&tabsysid=36&initWhere=wireid in (<%=dr["wireid"] %>)';}a();" name='Mango' toolText='<%=dr["overlinename"].ToString() + "  " + dr["starttowername"].ToString() %>' />  
     <%
         i++;
        }        
    } %>
</dataSet>

<trendlines>
        <line startValue='12' endValue='12' isTrendZone='0' displayValue='地面线'/>
</trendlines>
</chart>